#include<iostream>
#include<cstring>
using namespace std;

template<typename T>
void Sort(T* arr, int n);

int main()
{
	char arr[] = "buadhbc";
	Sort(arr, strlen(arr));
	cout << arr;
	return 0;
}

template<typename T>
void Sort(T* arr, int n)
{
	for (int i = 0; i < n - 1; i++)
	{
		int pos = i;
		for (int j = i + 1; j < n; j++)
		{
			if (arr[pos] > arr[j])
				pos = j;
		}
		T t = arr[pos];
		arr[pos] = arr[i];
		arr[i] = t;
	}
}
